package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.user.domain.FamilyMap1;
import com.ruoyi.user.mapper.FamilyMap1Mapper;
import com.ruoyi.user.service.IFamilyMap1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 家庭成员和家庭关联中间Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyMap1ServiceImpl implements IFamilyMap1Service
{
    @Autowired
    private FamilyMap1Mapper familyMap1Mapper;

    /**
     * 查询家庭成员和家庭关联中间
     * 
     * @param id 家庭成员和家庭关联中间主键
     * @return 家庭成员和家庭关联中间
     */
    @Override
    public FamilyMap1 selectFamilyMapById(Long id)
    {
        return familyMap1Mapper.selectFamilyMapById(id);
    }

    /**
     * 查询家庭成员和家庭关联中间列表
     * 
     * @param familyMap1 家庭成员和家庭关联中间
     * @return 家庭成员和家庭关联中间
     */
    @Override
    public List<FamilyMap1> selectFamilyMapList(FamilyMap1 familyMap1)
    {
        return familyMap1Mapper.selectFamilyMapList(familyMap1);
    }

    /**
     * 新增家庭成员和家庭关联中间
     * 
     * @param familyMap1 家庭成员和家庭关联中间
     * @return 结果
     */
    @Override
    public int insertFamilyMap(FamilyMap1 familyMap1)
    {
        familyMap1.setCreateTime(DateUtils.getNowDate());
        return familyMap1Mapper.insertFamilyMap(familyMap1);
    }

    /**
     * 修改家庭成员和家庭关联中间
     * 
     * @param familyMap1 家庭成员和家庭关联中间
     * @return 结果
     */
    @Override
    public int updateFamilyMap(FamilyMap1 familyMap1)
    {
        familyMap1.setUpdateTime(DateUtils.getNowDate());
        return familyMap1Mapper.updateFamilyMap(familyMap1);
    }

    /**
     * 批量删除家庭成员和家庭关联中间
     * 
     * @param ids 需要删除的家庭成员和家庭关联中间主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMapByIds(Long[] ids)
    {
        return familyMap1Mapper.deleteFamilyMapByIds(ids);
    }

    /**
     * 删除家庭成员和家庭关联中间信息
     * 
     * @param id 家庭成员和家庭关联中间主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMapById(Long id)
    {
        return familyMap1Mapper.deleteFamilyMapById(id);
    }
}
